﻿using System;
using System.Collections.Generic;
using GameFramework.Battle.Core;
using Gameplay.PVE.Utils;
using RootMotion.FinalIK;
using UnityEngine;
using UnityEngine.PlayerLoop;

namespace Gameplay.PVE.Survivor
{
    public class ShieldElement: ElementBase
    {
        public override void Execute()
        {
            target.AddShield(config.value);
        }

        public override bool NeedDispose()
        {
            if (target.shieldValue <= 0)
            {
                return true;
            }
            return base.NeedDispose();
        }

        public override void OnFree()
        {
           target.AddShield(-config.value);
        }

        public override bool IsImmediate()
        {
            return false;
        }
    }
}
